const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    openid: String,
    model: String,
    chexing: {
        type: String,
        default: 'xiaoche'
    },
    kemu: {
        type: String,
        default: 'keyi'
    },
    questions: Array,
    righttotal: {
        type: Number,
        default: 0
    },
    errtotal: {
        type: Number,
        default: 0
    },
    jindu: {
        type: Number,
        default: 0
    },
    studyJindu: {
        type: Number,
        default: 0
    },
})
if (!schema.options.toObject) schema.options.toObject = {};
schema.options.toObject.transform = function (doc, ret, options) {
  return ret
}

module.exports = mongoose.model('Wxsquestion', schema)